Skip to content

Conversation

thymikee
Copy link
Contributor

@thymikee thymikee commented May 5, 2025

Summary

While running run:android or run:ios we should be able to start a dev server and keep it open after the build is done

Test plan

Copy link

vercel bot commented May 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rnef Ignored Ignored Preview Oct 13, 2025 11:11am
rock Ignored Ignored Preview Oct 13, 2025 11:11am

logger.info('Starting dev server...');
startDevServer({
root: projectRoot,
reactNativePath: './node_modules/react-native',
Copy link
Collaborator

@adhorodyski adhorodyski Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this won't work in more complex setups, needs params (but it's temporary, right?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

@adhorodyski
Copy link
Collaborator

oops looke like the nx cache got in there

@OlimpiaZurek
Copy link
Collaborator

oops looke like the nx cache got in there

Yeah, not sure how to remove it. I don't see those changes in my commits

@adhorodyski
Copy link
Collaborator

adhorodyski commented Oct 10, 2025

.nx is somehow missing in the gitignore as well. Now I see they come from Mike'a initial WIP commit 😅 You can recreate that commit and force push it.

@adhorodyski
Copy link
Collaborator

adhorodyski commented Oct 10, 2025

@OlimpiaZurek can you link some video recordings from this feature in action? Could you please describe your UX concerns from our sync? Thanks!

@OlimpiaZurek
Copy link
Collaborator

@OlimpiaZurek can you link some video recordings from this feature in action? Could you please describe your UX concerns from our sync? Thanks!

Here’s the recording:

recording.mov

When we run the android app and have metro open there, and at the same time we also run the iOS app — if I want to reload or open the dev tools for iOS, I switch over to the iOS tab. It can be a bit confusing since metro is running in the android tab. I don’t think it’s a big issue though. It depends on how each dev works. Most people probably reload or open the dev tools straight from the simulator anyway.

root: projectRoot,
reactNativePath,
reactNativeVersion,
platforms: { ios: {}, android: {} },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can get these from api.getPlatforms()

platforms: { ios: {}, android: {} },
args: {
interactive: isInteractive(),
clientLogs: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be something like args.clientLogs || true

.gitignore Outdated
Comment on lines 48 to 50

# Nx
.nx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of adding nx to gitignore, use git rm --cached .nx locally

Comment on lines 53 to 55
if (startDevServer) {
logger.info('Starting dev server...');
startDevServer({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Android the dev server starts after binary is retrieved, and here it's before that. Running it here will cause the logs from both the bundler and the CLI to overwrite each other (you can see that on iOS example).

That's the tricky thing about this UX. We either need to:

  • wait for all build/cache retrieval to happen and then run the dev server to avoid clashing logs
  • start the dev server silently in the background and re-surface after the build is done / cache is retrieved – and we need to take into account that the bundler can be either Metro or Re.Pack (which is missing in this PR and should also expose the start field)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. I’ve changed it so the dev server starts after the build:

Screen.Recording.2025-10-13.at.13.06.45.mov

I’m focusing on the Metro part here. Should I also address Re.Pack in this PR, or do we want to handle that separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding it to Re.Pack would be lovely! especially that's it's pretty simple now (that's the reason I abstracted it this way)

Copy link
Contributor Author

@thymikee thymikee Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still have the logs interleaving each other:
image

Not the best DX. As a first iteration, I think it would be best to call metro server after the "success" log. Later on we could use grouping from @clack/prompts maybe together with Task Log feature, and move starting the server earlier. This would require further refactor of logging to be higher level, plus upgrading to latest v1-alpha, so it's better to tackle it separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants